import request from '@/utils/request'

// 获取所有的广告位及其对应的广告
function getAllAds (params) {
  return request({
    method: 'GET',
    url: '/front/ad/getAllAds',
    params
  })
}

// 课程分页查询
function getQueryCourses (data) {
  return request({
    method: 'POST',
    url: '/boss/course/getQueryCourses',
    data
  })
}

// 获取已购课程
function getPurchaseCourse () {
  return request({
    method: 'GET',
    url: '/front/course/getPurchaseCourse'
  })
}

// 获取课程详情
function getCourseById (params) {
  return request({
    method: 'GET',
    url: '/front/course/getCourseById',
    params
  })
}

// 获取课程章节
function getSectionAndLesson (params) {
  return request({
    method: 'GET',
    url: '/front/course/session/getSectionAndLesson',
    params
  })
}

// 通过课时ID获取媒体信息
function videoPlayInfo (params) {
  return request({
    method: 'GET',
    url: '/front/course/media/videoPlayInfo',
    params
  })
}

export {
  getAllAds,
  getQueryCourses,
  getPurchaseCourse,
  getCourseById,
  getSectionAndLesson,
  videoPlayInfo
}
